

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
}

.header {
    background: #04a4cc;
    color: #fff;
    text-align: center;
    padding: 1rem; 
}

.search {
    width: 600px;
    margin: 0 auto;
    padding: 1rem 0;
}

.search input {
    width: calc(100% - 100px);
    float: left;
}

.search button {
    width: 100px; 
    float: right; 
}

.main {
    display: flex;
}

.sidebar {
    width: 250px;
    background: #eee;  
}

.panel {
    background: #fff; 
    margin-bottom: 1rem;  
}

.panel-heading {
    background: #04a4cc;
    color: #fff;
    padding: 1rem;
    font-weight: bold;
}


/* friend */
.friend-groups {
    list-style: none;
    padding: 1rem 2rem;
}

.friend-list {
    list-style: none;
    padding: 1rem 2rem; 
}

.friend {
    margin-bottom: 1rem; 
}

.friend img {
    width: 30px;
    height: 30px;  
}

.friend p {
    display: inline-block;
    vertical-align: middle;
    margin-left: 1rem;
}


/* group */
.groups-list .panel-body {
    padding: 0;
}

.group-list {
    list-style: none;
    padding: 1rem 2rem; 
}

.group {
    margin-bottom: 1rem;
}

.group img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    vertical-align: middle;  
}

.group p {
    display: inline-block;
    vertical-align: middle;
    margin-left: 1rem; 
}


/* setting */
.settings-list .panel-body {
    padding: 0; 
}

.settings-list li {
    border-bottom: 1px solid #eee;
    padding: 1rem 2rem;
}

.settings-list li:last-child {
    border-bottom: none;
} 

.settings-list a {
    text-decoration: none;
    color: #333;
}

.settings-list a:hover {
    color: #04a4cc;
}

.badge {
    background: #04a4cc;
    padding: 0.5rem 1rem;
    border-radius: 5rem;  
    color: #fff;
    font-size: 1rem;
}

.badge-success {
    background: #11c26d; 
}

.badge-warning {
    background: #fbbc05;
}


/* chat */
.chat {
    max-height: 600px;
    overflow-y: scroll;
    flex-grow: 1;
    background: #fff;
    margin-left: 250px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;  
}

.chat img {
    width: 30px;
    height: 30px;
}


.chat::-webkit-scrollbar {
    width: 10px;     /* 滚动条宽度 */
}

.chat::-webkit-scrollbar-track {
    background: #f1f1f1;    
}

.chat::-webkit-scrollbar-thumb {
    background: #888;   
}

.chat::-webkit-scrollbar-thumb:hover {
    background: #555;  
}


.chat.scrollToBottom {
    height: 600px;  
    overflow-y: scroll;
}

.chat-body {
    overflow-y: scroll;
}

.chat-body::-webkit-scrollbar {
    /* 滚动条样式 */  
}

.chat-header p {
    display: inline-block;
    vertical-align: middle;
    margin: 0 0 0 0.5rem;
}

.chat-footer {
    background: #f7f7f7;
    padding: 1rem; 
    position: fixed;
    bottom: 0;
    width: 100%;
}

.chat-footer textarea {
    resize: none;        /* 不可手动调整尺寸 */
    height: 5rem;        /* 初始高度 */
    overflow-y: hidden;  /* 隐藏多出部分 */
}

.chat-footer input {
    max-width: 80%;   /* 最大宽度80% */
    border-right: none;
    box-shadow: none;
}

.chat-footer button {
    border-left: none;
    border-radius: 0 0.25rem 0.25rem 0;
}  

.chat-footer.sending {
    background: #d1faea;
}

.chat-footer.sent {
    background: #e2fdfd;
}


.message {
    padding: 1rem;
    background: #f7f7f7;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    max-width: 50%;   /* 最大宽度50% */ 
    overflow: hidden;  /* 超出隐藏 */
}

.message-right {
    background: #e2fdfd;
}

.message, 
.chat-footer {
    transition: all 0.2s ease;  
}

.message:hover,
.chat-footer:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
}


.message-text {
    background: #fff;  
}

.message-image {
    padding: 0;  
}

.message-image img {
    width: 100%;
    border-radius: 0.25rem 0.25rem 0 0;  
}

.message-voice {
    background: #e8f6fb;
    padding: 0;
}

.message-voice audio {
    width: 100%;
}

.message-video {
    background: #e8f6fb;
    padding: 0;  
}

.message-video video {
    width: 100%;
    border-radius: 0.25rem;
}


.message.at {
    border-left: 0.25rem solid #ffa94d;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.message.unread {
    border-left: 0.25rem solid #ff4545;
    padding-left: 1rem;
    margin-left: 0.5rem;
}


.message.slideIn {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
}

@media (min-width: 1000px) {  
    .message {
        max-width: none;   /* 取消最大宽度 */
    }
    
    .chat-footer input {
        max-width: none;   /* 取消最大宽度 */
    }
}



.fa {
    font-family: FontAwesome;
    margin-right: 0.5rem;
}

.close {
    float: right;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    background: #ccc;
    border-radius: 50%;
}

.time {
    color: #999;
    text-align: center;
    display: block;
    margin-bottom: 0.5rem;  
}

.send {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    color: #fff;
    background: #04a4cc;
    transition: all 0.2s ease;
}

.send:hover {
    background: #0398bb;
}

